package com.github.ilioili.justdoit.model.pojo;

import com.github.ilioili.justdoit.util.sql.SqlField;

/**
 * Created by User on 16/6/23.
 */
public class Category {
    @SqlField(type = SqlField.SqlType.PRIMARY_KEY)
    public String name;
    public int color;
    public int importance;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Category category = (Category) o;

        if (color != category.color) return false;
        if (importance != category.importance) return false;
        return name != null ? name.equals(category.name) : category.name == null;

    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + color;
        result = 31 * result + importance;
        return result;
    }
}
